package com.nhim.cms.admin.server;

import java.util.List;

import org.springframework.stereotype.Service;

import com.nhim.cms.dao.GroupDAO;
import com.nhim.cms.domain.Group;
import com.nhim.cms.util.GroupManager;

@Service("GroupService")
public class GroupService {
	
	public static List<Group> findAll() {
		
		return GroupDAO.getInstance().findAll();
	}
	public static Boolean remove(Integer id)
	{
		try {
			GroupManager.getInstance().delete(id);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}
	public static Group persit(Group element)
	{
		try {
			return GroupManager.getInstance().saveOrUpdate(element);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
		
	}
}
